from tkinter import *
class MainWindow:
  def __init__(self):
    self.frame = Tk()
    self.label_name=Label(self.frame,text="姓名：")
    self.label_age=Label(self.frame,text="年龄：")
    self.label_sex=Label(self.frame,text="性别：")
    self.text_name=Text(self.frame,height=1,width=30)
    self.text_age=Text(self.frame,height=1,width=30)
    self.text_sex=Text(self.frame,height=1,width=30)
    self.label_name.grid(row=0,column=0)
    self.label_age.grid(row=1,column=0)
    self.label_sex.grid(row=2,column=0)
    self.text_name.grid(row=0,column=1)
    self.text_age.grid(row=1,column=1)
    self.text_sex.grid(row=2,column=1)
    self.button_ok=Button(self.frame,text="确定",width=10)
    self.button_cancel=Button(self.frame,text="取消",width=10)
    self.button_ok.grid(row=3,column=0)
    self.button_cancel.grid(row=3,column=1)
    self.frame.mainloop()
frame=MainWindow()
